package com.mengchengnet.chaperonage;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.mengchengnet.chaperonage.ui.activity.MainActivity;

/**
 * Created by Administrator on 16-1-5.
 */
public class BaseFragment extends Fragment {

    public static MainActivity mainActivity;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        return super.onCreateView(inflater, container, savedInstanceState);
    }

    @Override
    public void onStart() {
        super.onStart();
        mainActivity = (MainActivity) getActivity();
    }

    @Override
    public void onResume() {
        super.onResume();
        mainActivity.currentFragment = this;
    }

    public void startActivity(Class<?> c) {
        Intent intent = new Intent(mainActivity, c);
        startActivity(intent);
    }
}
